﻿function getTotalCallCMD(){
	return "01030000000A,1";
}

function getReciveIDVAL(up_cmd,down_cmd){
	print("up_cmd:"+up_cmd);
	print("down_cmd:"+down_cmd);
	if(1==(up_cmd.length%2))
	{
		print("up_cmd length is not right.");
		return "";
	}
	if(up_cmd.length<=46)
	{
		print("up_cmd length is less than right.");
		return "";
	}
	var index = up_cmd.indexOf("0103");
	if(0!=index){
		print("up_cmd func is not right.");
		return "";
	}
	print("index:"+index);
	var lLen = up_cmd.substr(4,2);
	print("lLen:"+lLen);
	var dlen = parseInt("0X"+lLen);
	print("dlen:"+dlen);
	if(dlen<0){
		print("up_cmd data length is error.");
		return "";
	}
	var ret_desc="";
	var id = 0;
	var size = (dlen/2);
	for(var i=6;i<(6+2*dlen);i+=4)
	{
		var valHStr = up_cmd.substr(i,2);
		var valLStr = up_cmd.substr(i+2,2);
		var val = 256*parseInt("0X"+valHStr)+parseInt("0X"+valLStr);
		print("val:"+val);
		ret_desc+=(id+","+val);
		if(id<(size-1)){
			ret_desc+=";";
		}
		id+=1;
	}
	return ret_desc;
}
